<template>
<el-dialog
        :close-on-click-modal="false"
        class="rl-dialog-header"
        :title="stype"
        :visible.sync="formVisible"
        @open="formInit"
        style="width: 40%; margin: 0 auto;"
        :before-close="dialogClose"
        width="80%"
    >
    <div style="width: 100%; height: auto">
        <!-- 基本信息 -->
        <div style="border: 0px solid #f00; margin-top: 0.5%; border-radius: 25px; background-color: #fff">
            <div style="width: 98%; margin-left: 1%">
                <!-- <el-divider></el-divider> -->
                <br />
                <el-form :model="form" status-icon label-width="130px" label-position="left" class="demo-ruleForm">
                    <el-row class="row_Css">
                        <el-col :span="15">
                            <el-form-item label="名称" prop="name">
                                <el-input v-model="form.name" placeholder=""></el-input>
                            </el-form-item>
                        </el-col>
                        <span style="color: red">* </span>
                    </el-row>
                    <el-row class="row_Css">
                      <el-col :span="15">
                                    <el-form-item label="开始时间" prop="startTime">
                                        <el-date-picker
                                            v-model="form.startTime"
                                            type="date"
                                            value-format="yyyy-MM-dd"
                                            placeholder="选择日期"
                                        >
                                        </el-date-picker>
                                    </el-form-item>
                                </el-col>
                                <span style="color: red">* </span>
                    </el-row>
                    <el-row class="row_Css">
                      <el-col :span="15">
                                    <el-form-item label="结束时间" prop="endTime">
                                        <el-date-picker
                                            v-model="form.endTime"
                                            type="date"
                                            value-format="yyyy-MM-dd"
                                            placeholder="选择日期"
                                        >
                                        </el-date-picker>
                                    </el-form-item>
                                </el-col>
                                <span style="color: red">* </span>
                    </el-row>
                    <el-row class="row_Css">
                        <el-col :span="15">
                            <el-form-item label="描述" prop="content">
                                <el-input v-model="form.content" autosize placeholder=""></el-input>
                            </el-form-item>
                        </el-col>
                        
                    </el-row>
                </el-form>
            </div>
        </div>
        <br />
        <!-- 录入信息 -->
        
        <!-- 按钮 -->
        <div style="text-align: center">
            <el-button class="qr_but" @click="save"><span class="font_qr">确认</span></el-button>
            <!-- <el-image :src="qr_img" style="width: 30px; height: 30px"></el-image> -->
            <!-- <el-image :src="submit_img" style="width: 150px; height: 60px" @click="save"></el-image> -->
        </div>
    </div>
</el-dialog>
</template>
<script>
import role from '@/api/system_setting/role_manager.js';

export default {
    name:'role_input',
    props: ['formVisible', 'formData'],
    data() {
        return {
            qr_img:require('../../assetssystem/determine.png'),
            submit_img: require('../../assets/imgs/组 422.png'),
            delete_img: require('../../assets/imgs/组 423.png'),
            labelPosition: 'left',
            form: {},
            stype:'',
        };
    },
    created() {
        this.init();
    },
    watch: {
        //监听
        $route(to, from) {
            //路由变化方式，路由发生变化，方法就会执行
            this.init();
        }
    },
    methods: {
        formInit(){
            let data=this.formData
            if(data == ''||data == null){

            }else{
             this.form=this.formData
             this.form.status=parseInt(this.formData.status)
             this.stype='参数编辑'
             }
        },
        // 提交
        save(){
            let param={}
            param=this.form
             this.$post('/sysManage/parameter/save', param).then((res) => {
                 if(res.code == '2000'){
                    this.$message.success('保存成功!');
                    this. dialogClose();
                 }else{
                     this.$message.error(res.message);
                 }
               
            });
        },
        init() {
        
        },
        dialogClose() {
            this.fileList = [];
            this.form = {};
            this.$emit('closeDialog', false);
        },
    }
};
</script>
<style scoped>
/* 输入框样式 */
.el-input--small .el-input__inner {
    background: #fff;
    border: 1px solid #2e8ccc;
}
.input_css {
    background: #fff;
    border: 1px solid #2e8ccc;
    border-radius: 4px;
}
.el-textarea__inner {
    background: #fff;
    border: 1px solid #2e8ccc;
    height: 70px !important;
}
.fontStyle {
    font-size: 20px;
    font-family: '微软雅黑';
    color: #2e8ccc;
    font-weight: 600;
}
.el-divider--horizontal {
    margin: 10px 0;
    background-color: #2e8ccc;
    height: 2px;
}
.row_Css {
    font-size: 18px;
    font-family: '微软雅黑';
    color: #000;
    font-weight: 600;
}
/* /deep/.el-form-item__label{
    text-align: 'left'  !important;
} */
.qr_but{
    border-radius: 10px;
    width: 120px;
    color: #fff;
    background-color: rgb(78 165 191);
    border-color: none;
    font-size: 14px;
}
.font_qr{
margin: 0 auto;
text-align: center;
margin-left: 10px;
}
</style>
